package com.studyadmin.controller;


import com.studyadmin.service.StudentVideoService;
import com.studyadmin.service.VideoService;
import com.studyadmin.util.JsonUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author lyl
 * @since 2023-03-25
 */
@RestController
@RequestMapping("/studyadmin/student-video")
@CrossOrigin
public class StudentVideoController {
    @Autowired
    StudentVideoService studentVideoService;
    /**
     * 根据章节ID获取上次播放进度
     * @param chaId 课程id
     * @return 结果
     */
    @GetMapping("/progress")
    public JsonUtil chapterContent(@RequestParam(value = "chaId") String chaId,
                                   @RequestParam(value = "stuNum") String stuNum){
//        System.out.println("章节内容id"+chaId);
        return studentVideoService.videoProgress(chaId,stuNum);
    }
}

